home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_04 / mae.doc < prev    next >
Text File  |  1994-03-06  |  4KB  |  93 lines

  1. The Micro Ascii Encoder (MAE) is a program which encodes one or more binary
  2. files into an ASCII text file.  This is usually performed in order to transmit
  3. the file(s) over an electronic mail service, or some other medium in which
  4. binary data cannot be exchanged. Once the data is received, MAE can be used
  5. to decode the ASCII file, and re-generate the original binary files.
  6.  
  7.  
  8. The format of the MAE command is:
  9.  
  10.     MAE [options] [archive] [files...]
  11.  
  12.  
  13. [options]:
  14.   +a     - Archive: Encode the specified files into the named ASCII archive.
  15.   +r     - Restore: Retrieve the named files from the specified ASCII archive.
  16.            (if neither '+a' or '+r' are given, MAE lists contents of archive)
  17.   t=file - Load encoder table from named file (default extension is ".MAT")
  18.            File must contain a single line, exactly 66 character long. First
  19.            character is START MARKER, next is END MARKER, and remaining 64
  20.            characters are the six bit -> ASCII encoder table (See later).
  21.   -v     - Verbose off: Disables MAE's progress messages
  22.   w=     - Width: Sets the number of columns in the output file (default 65).
  23.            (Only has effect with '+a')
  24.  
  25.  
  26. [archive]:
  27.   This is the name of the ASCII archive file to be read or written. If an
  28.   extension is not explicitly specified, it defaults to ".MAE".
  29.  
  30.  
  31. [files...]:
  32.   These are the names of the binary files to be archived/retrieved/listed
  33.   from the ASCII archive. If no names are specified, MAE will archive ALL
  34.   files in the current directory, or retrieve/list ALL files in the archive.
  35.  
  36.   Filenames may include the following wildcard characters:
  37.  
  38.     ?  - Matches any single character in the filename or extension
  39.     *  - Matches all remaining characters in the filename or extension
  40.  
  41.  
  42. Examples:
  43.  
  44.    MAE +a DRAWINGS *.DWG     ; Archive all ".DWG" files to DRAWINGS.MAE
  45.    MAE +a A:CSOURCE.ASC *.C  ; Archive all ".C" files to A:CSOURCE.ASC
  46.    MAE +r A:IFILES *.?86     ; Retrieve files with extensions ending in "86"
  47.  
  48.  
  49. MAE Archive format:
  50.  
  51. Each MAE ASCII archive file has the following format:
  52.  
  53.  - START MARKER (Default = '{' )
  54.  ASCII encoded binary NAME of file #1
  55.  ASCII encoded binary SIZE of uncompressed file #1
  56.  ASCII encoded binary SIZE of compressed file #1
  57.  ASCII encoded binary DATA of file #1
  58.  ... Repeat for each file ...
  59.  - END MARKER   (Default = '}' )
  60.  
  61. ASCII encoded binary data is stored in a 4/3 form.
  62. Every four bytes of ASCII data contains three bytes of binary data.
  63.  
  64. Six bits are encoded in each ASCII character. The six bit value is used to
  65. index into the 64 character encoder table to get a character. The default
  66. encoder table consists of these characters:
  67.  
  68. abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.,
  69.  
  70. Every four characters in the output file comprise a "block". The six
  71. bits in the first character in the block identifies the upper two bits
  72. for each successive character in the block:
  73.  
  74. Eaxmple: to encode the hex byte sequence: 0x84, 0x53, 0xF5
  75.  
  76.    0x84 -> 10000100 -> 000100 -> Table index of 4  -> 'a'
  77.    0x53 -> 01010011 -> 010011 -> Table index of 19 -> 's'
  78.    0xF5 -> 11110101 -> 110101 -> Table index of 53 -> 'Q'
  79.    Upper bits        > 100111 -> Table index of 39 -> 'C'
  80.  
  81. This value would be encoded as 'CasQ'
  82.  
  83. All data before the START MARKER, and after the END MARKER is ignored by MAE.
  84. ASCII data contained within the markers is assumed to be encoded binary data.
  85. Control characters (<= ' ') are ignored within the data block.
  86.  
  87. The file data is compressed (LZSS Adaptive Huffman Coding), which usually
  88. more than compensates for the 4/3 expansion introduced by the ASCII encoding
  89. process, resulting in compact output files.
  90.  
  91. MAE is "Freely Distributable", and may be used and distributed without payment
  92. or royalty.
  93.